package pkmn.move;

import pkmn.Pokemon;
import pkmn.battle.BattlePokemon;
import pkmn.status.BattleStatusEnum;
import pkmn.type.Grass;
import pkmn.type.Type;
import pkmn.util.Util;

public class ApplySeed extends IndirectAction{
    @Override
    public void execute(BattlePokemon battlePokemon){
        //don't work on grass types
        for (Type type : battlePokemon.getPokemon().getTypes()){
            if (type.equals(new Grass())){
                Util.printAndWait(battlePokemon + " evade attack!");
                return;
            }
        }
        //verify if already seeded
        if (battlePokemon.haveBattleStatus(BattleStatusEnum.seed)) {
            Util.printAndWait("But, it failed!");
            return;
        }
        //set status
        battlePokemon.setBattleStatus(BattleStatusEnum.seed);
        Util.printAndWait(battlePokemon + " was seeded!");
    }
}
